package com.zlcx.tz.live.enums;


public enum MessageType {

    Text("文本信息", "300", "app"),
    JoinRoom("进入房间", "301", "app"),
    LeaveRoom("离开房间", "302", "app"),
    ShareRoomToPerson("分享某个房间到私聊", "104", "app"),
    ShareRoomToGroup("分享某个房间到群聊", "204", "app"),
    ShareGroupToRoom("分享某个群到房间", "303", "app"),
    ShareRoomToRoom("分享某个房间到房间", "304", "app"),
    ApplyPublish("申请上麦", "306", "app"),
    CancelApplyPublish("取消上麦申请", "307", "app"),
    AgreeApplyPublish("房主同意上麦", "308", "app"),
    QuitPublish("下麦", "309", "app"),
    OperateAllMic("全员禁麦操作", "310", "app"),
    OperateSelfMic("自己麦克操作", "311", "app"),
    HostChange("切换房主", "312", "app"),
    KickingUser("踢人", "313", "app"),
    SystemKickingUser("系统踢人", "323", "app"),
    CloseRoom("关闭房间", "314", "app"),
    AdminCloseRoom("强制关闭房间", "315", "app"),
    HeartMissCloseRoom("心跳丢失关闭房间", "317", "app"),

    TIME_LEARN_ROOM_TEXT("计时自习室-文本消息", "400", "app"),
    TIME_LEARN_ROOM_ENTER("计时自习室-进入消息", "411", "app"),
    TIME_LEARN_ROOM_EXIT("计时自习室-离开消息", "412", "app"),
    TIME_LEARN_ROOM_TAKE_SEAT("计时自习室-入座", "421", "app"),
    TIME_LEARN_ROOM_SIT_UP("计时自习室-离开座位", "422", "app"),
    USER_ONLINE("用户-用户上线", "601", "app"),
    USER_OFFLINE("用户-用户上线", "602", "app"),
    TIME_LEARN_ROOM_TAKE_SEAT_NOTICE("计时自习室-入座", "603", "app"),
    TIME_LEARN_ROOM_SIT_UP_NOTICE("计时自习室-离开座位", "604", "app"),

    DynamicCreateRoom("动态-创建房间", "750","web"),
    DynamicCloseRoom("动态-关闭房间", "751","web"),
    PersonalDynamic("个人动态", "700","web"),
    ;

    MessageType(String tips, String code, String connectType) {
        this.tips = tips;
        this.code = code;
        this.connectType = connectType;
    }

    private String tips;
    private String code;
    private String connectType;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public String getConnectType() {
        return connectType;
    }

    public void setConnectType(String connectType) {
        this.connectType = connectType;
    }

    public static MessageType getMsgType(String code) {
        for (MessageType field : MessageType.values()) {
            if (code.equals(field.getCode())) {
                return field;
            }
        }
        return null;
    }
}
